package frsf.cidisi.exercise.arqueologic.situationCalculus;

import frsf.cidisi.faia.agent.Action;
import java.util.Vector;
import frsf.cidisi.faia.agent.Agent;
import frsf.cidisi.faia.environment.Environment;


public class ArqueologicEnvironment extends Environment {

    public ArqueologicEnvironment() {
        this.environmentState = new ArqueologicEnvironmentState();
    }

    @Override
    public ArqueologicEnvironmentState getEnvironmentState() {
        return (ArqueologicEnvironmentState) super.getEnvironmentState();
    }

    @Override
    public boolean agentFailed(Action action) {

        //TODO: Complete Method

        return false;
    }

    @Override
    public ArqueologicAgentPerception getPercept() {
        ArqueologicAgentPerception p = new ArqueologicAgentPerception();

        p.setCofre(this.getEnvironmentState().getmundo().getCofre(this.getEnvironmentState().getposicionArqueologo()));
        p.setDestino(this.getEnvironmentState().getdestino());
        p.setMundo(this.getEnvironmentState().getmundo());
        p.setPosicion(this.getEnvironmentState().getposicionArqueologo());

        return p;
    }
    
    public int getVerCofre(){
    	return ((ArqueologicEnvironmentState) this.environmentState).getmundo().getAldea(((ArqueologicEnvironmentState) this.environmentState).getposicionArqueologo()).getPercepcion();
    }

	@Override
    public String toString() {
        return this.environmentState.toString();
    }
	
}
